package com.leo.foodmaster.admin.purchase.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;
import com.leo.foodmaster.commons.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 采购单
 * </p>
 *
 * @author Leo
 * @since 2021-08-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="PurchaseBill对象", description="采购单")
public class PurchaseBill implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "自增主键Id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "采购单编号")
    @Excel(name = "采购单编号")
    private String serialNum;

    @ApiModelProperty(value = "采购日期")
    @Excel(name = "采购日期")
    private LocalDate purchaseDate;

    @ApiModelProperty(value = "所属公司Id")
    private Long organId;

    @ApiModelProperty(value = "支付状态：0（未支付）1（未付清）2（已支付）")
    @Excel(name = "支付状态", dictType = "purchase_pay_status")
    private String payStatus;

    @ApiModelProperty(value = "采购金额")
    @Excel(name = "采购金额")
    private BigDecimal amountOfMoney;

    @ApiModelProperty(value = "预付金额")
    @Excel(name = "预付金额")
    private BigDecimal prepayment;

    @ApiModelProperty(value = "未付金额")
    @Excel(name = "未付金额")
    private BigDecimal unpaidAmount;

    @ApiModelProperty(value = "付款方式：1（现金）2（微信）3（支付宝）4（银行卡转账）")
    @Excel(name = "支付状态", dictType = "purchase_payment_type")
    private String paymentType;

    @ApiModelProperty(value = "采购人Id")
    private Long purchaseById;

    @ApiModelProperty(value = "采购人")
    @Excel(name = "采购人")
    private String purchaseBy;

    @ApiModelProperty(value = "供应商Id")
    private Long supplierId;

    @ApiModelProperty(value = "供应商")
    @Excel(name = "供应商")
    private String supplier;

    @ApiModelProperty(value = "采购单状态：0（未审核）1（审核不通过）2（已审核）3（入库中）4（已入库）")
    @Excel(name = "支付状态", dictType = "purchase_pay_status")
    private String status;

    @ApiModelProperty(value = "采购单类型：1（批量）2（临时）")
    @Excel(name = "支付状态", dictType = "purchase_bill_type")
    private String billType;

    @ApiModelProperty(value = "备注")
    @Excel(name = "备注")
    private String remark;

    @ApiModelProperty(value = "供应商公司Id")
    private Long supplierOrganId;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建人")
    private String creator;

    @ApiModelProperty(value = "修改人")
    @TableField(fill = FieldFill.UPDATE)
    private String updateUser;

    @ApiModelProperty(value = "审核人Id")
    private Long checkById;

    @ApiModelProperty(value = "审核人")
    @Excel(name = "审核人")
    private String checkBy;

    @ApiModelProperty(value = "审核时间")
    @Excel(name = "审核时间")
    private LocalDateTime checkTime;

    @TableField(exist = false)
    private List<PurchaseBillDetails> detailList;

}
